package com.swpu.cbg.cnshop.utils;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by chenboge on 16/2/11.
 */
public class SharperenceUtil {

    private static final String ShareName="cnShop";
    private static SharedPreferences mSharedPreferences;


    private static SharedPreferences getmSharedPreferences(Context context){
        return context.getSharedPreferences(ShareName, Context.MODE_PRIVATE);
    }

   public static String getString(Context context,String sName) {
       SharedPreferences sharedPreferences = getmSharedPreferences(context);
       return sharedPreferences.getString(sName,null);
   }

    public static void putString(Context context,String sName,String value) {
        SharedPreferences sharedPreferences = getmSharedPreferences(context);
        SharedPreferences.Editor editor = sharedPreferences.edit();
        editor.putString(sName, value);
        editor.commit();
    }


}
